package tech.topcoder.springcloud.simpleweb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import tech.topcoder.springcloud.simpleweb.service.DemoService;

import javax.annotation.Resource;

/**
 * Created by hhj on 17-4-14.
 */
@Controller
@RequestMapping("/demo")
public class DemoController extends BaseController {

    @Resource
    private DemoService demoService;

    @RequestMapping("/list")
    @ResponseBody
    public Object list(@RequestParam(defaultValue = "0") int start,
                       @RequestParam(defaultValue = "10") int length,
                       @RequestParam(defaultValue = "") String keyword) {
        return demoService.getList(start, length, keyword);
    }
}
